<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class VideoLink extends Model
{
    protected $table = 'video_link';

    protected $casts = [
        'created_at' => 'datetime:Y-m-d H:i:s',
        'updated_at' => 'datetime:Y-m-d H:i:s'
    ];


    const EMPTY_DATA = 0;
    const WHALE_SKIT = 1;
    const SUPER_SKIT = 2;

    const LOOK_DUCK_SKIT = 3;

    const WHALE_SKIT_DATA = [
        'appid' => 'wxa948194190ba4bb6',
        'original_id' => 'gh_d1ff35a1b7c0'
    ];

    const SUPER_SKIT_DATA =[
        'appid' => 'wx727723b79d7f3098',
        'original_id' => 'gh_547bdc5ff610'
    ];

    const LOOK_DUCK_SKIT_DATA = [
        'appid' => 'wxc6344d0f46fb002b',
        'original_id' => 'gh_fdddbbb67cd0'
    ];


    static function getWxId()
    {
        $ret = [
            self::EMPTY_DATA => '无选择微信',
            self::WHALE_SKIT => '鲸鱼短剧',
            self::SUPER_SKIT => '超级短剧',
            self::LOOK_DUCK_SKIT => '看鸭短剧'
        ];

        return $ret;
    }

    static function getWxInfo($id,$link)
    {
        $ret = [
            self::EMPTY_DATA => '',
            self::WHALE_SKIT => json_encode(array_merge(self::WHALE_SKIT_DATA,['link' => $link])),
            self::SUPER_SKIT => json_encode(array_merge(self::SUPER_SKIT_DATA,['link' => $link])),
            self::LOOK_DUCK_SKIT => json_encode(array_merge(self::LOOK_DUCK_SKIT_DATA,['link' => $link])),
        ];

        return $ret[$id];
    }
}
